package com.fac.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@ApiModel(description = "创建维修工单请求参数")
public class RepairOrderCreateDTO implements Serializable {

    @NotNull(message = "设备ID不能为空")
    @ApiModelProperty(value = "设备ID", example = "1", required = true)
    private Long equipmentId;

    @NotBlank(message = "故障描述不能为空")
    @ApiModelProperty(value = "故障描述", example = "设备无法启动", required = true)
    private String faultDescription;

    @NotNull(message = "优先级不能为空")
    @ApiModelProperty(value = "优先级：0低，1中，2高", example = "1", required = true)
    private Integer priority;

    @NotBlank(message = "联系人不能为空")
    @ApiModelProperty(value = "联系人", example = "张三", required = true)
    private String contactPerson;

    @NotBlank(message = "联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "联系电话", example = "13800138000", required = true)
    private String contactPhone;
} 